package com.itlong.cloud.user.propertyapp;

import com.itlong.cloud.POJO.DTO.app.property.app.PropertyAppInspectDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      物业APP消息管理模块服务接口暴露
 * </desc>
 *
 * @createDate  2020/1/3
 */
@FeignClient("user-service")
public interface IPropertyAppMessageServiceClient {

    /**
     * <desc>
     *      保存公告/内部通知信息
     * </desc>
     *
     * @param projectId 项目id
     * @param title 标题
     * @param postMan 发布人
     * @param content 发布内容
     * @return
     * @Author Zhu.yj
     * @createDate  2020/1/3
     */
    @PostMapping("/home/postNotice")
    Integer postNotice(@RequestParam("projectId") String projectId,
                       @RequestParam("title") String title,
                       @RequestParam("postMan") String postMan,
                       @RequestParam("content") String content,
                       @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      获取公告列表
     * </desc>
     *
     * @param projectId 项目id
     * @param pageNum 页码（每页15条）
     * @return
     * @Author Zhu.yj
     * @createDate  2020/1/3
     */
    @PostMapping("/home/getNoticeList")
    Map<String, Object> getNoticeList(@RequestParam("projectId") String projectId,
                                      @RequestParam("pageNum") String pageNum,
                                      @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      获取消息详情，标记已读信息
     * </desc>
     *
     * @param projectId 项目id
     * @param noticeId 消息id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/1/3
     */
    @PostMapping("/home/getNoticeDetail")
    Map<String, Object> getNoticeDetail(@RequestParam("projectId") String projectId,
                                        @RequestParam("noticeId") String noticeId,
                                        @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      获取消息中心列表
     * </desc>
     *
     * @return 消息中心列表
     * @author wangzhi
     * @createDate 2020/02/17
     */
    @PostMapping("/home/getMessagesList")
    Map<String, Object> getMessagesList(@RequestBody PropertyAppInspectDTO propertyAppInspectDTO) throws Exception;

    /**
     * <desc>
     *      获取公告消息内容列表
     * </desc>
     *
     * @param projectId 项目id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/3/13
     */
    @PostMapping("/home/getNoticeContent")
    List<String> getNoticeContent(@RequestParam("projectId") String projectId) throws Exception;
}
